import * as React from 'react';
import { Table } from 'antd'
import { IPro } from './pro';
interface IAppProps {
  // 我爱你
  proList: IPro[]
}

const TableList: React.FunctionComponent<IAppProps> = (props) => {
  const columns: any = [
    {
      title: '序号',
      render (text: any, record: IPro, index: number) {
        return <span>{ index + 1 }</span>
      }
    },
    {
      title: '名称',
      dataIndex: 'proname'
    }
  ]
  return (
    <Table
      columns = { columns }
      dataSource = { props.proList }
      rowKey = "proid"
    ></Table>
  );
};

export default TableList;
